import request from "../utils/request";

export interface ILogin {
    email: string,
    password: string,
    code: string
}

export class Users {
    static getCode = (email: string) => request({
        url: "/users/getCode",
        method: "GET",
        params: {email}
    })

    static loginByPassword = (data: ILogin) => request({
        url: "/users/loginbypassword",
        method: "POST",
        data
    })
    static loginByCode = (data: ILogin) => request({
        url: "/users/loginbycode",
        method: "POST",
        data
    })
    static regist = (data: ILogin) => request({
        url: "/users/regist",
        method: "POST",
        data
    })
    static forget = (data: ILogin) => request({
        url: "/users/forget",
        method: "POST",
        data
    })
}